﻿using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NDF
{
    /// <summary>
    /// 提供一组针对 <see cref="System.Dynamic.DynamicObject"/> 对象的常见操作工具方法。
    /// </summary>
    public static class DynamicObjectHelper
    {
        /// <summary>
        /// 获取当前 <see cref="System.Dynamic.DynamicObject"/> 对象的所有动态属性。
        /// </summary>
        /// <param name="dynamicObject">一个 <see cref="System.Dynamic.DynamicObject"/> 类型对象。</param>
        /// <returns>当前 <see cref="System.Dynamic.DynamicObject"/> 对象的所有动态属性。</returns>
        public static IEnumerable<string> GetProperties(this DynamicObject dynamicObject)
        {
            return dynamicObject.GetDynamicMemberNames();
        }
    }
}
